package com.eveinfo.api.character.skilltraining;

import java.io.IOException;

import javax.xml.parsers.ParserConfigurationException;

import org.xml.sax.SAXException;

import com.eveinfo.api.AbstractApiParser;
import com.eveinfo.api.ApiAuth;
import com.eveinfo.api.ApiException;
import com.eveinfo.api.NoCacheFoundExecption;

public class SkillTrainingParser extends AbstractApiParser<ApiSkillTraining,SkillTrainingHandler> {
	
	protected static final String CHARACTER_SHEET_URL = Path.CHARACTER.getPath() + "/SkillInTraining.xml.aspx";

	private static SkillTrainingParser instance;
	
	public static SkillTrainingParser getInstance(){
		if(instance == null){
			instance = new SkillTrainingParser();
		}
		return instance;
	}
	
	private SkillTrainingParser() {
		super(ApiSkillTraining.class, 1, CHARACTER_SHEET_URL);
	}

	public ApiSkillTraining getSkillInTraining(ApiAuth auth) throws IOException,
			SAXException, ParserConfigurationException, ApiException, NoCacheFoundExecption {
		SkillTrainingHandler handler = new SkillTrainingHandler();
		return getResponse(auth, handler);
	}

	public static boolean isInstancier() {
		return instance != null;
	}
	
}